/**
 * email
 * @param {*} s
 */
export function isEmail (s) {
  // return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
  return /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,}$/.test(s)
}

/**
 * phoneNumber
 * @param {*} s
 */
export function isMobile (s) {
  return /^1[0-9]{10}$/.test(s)
}

/**
 * telephoneNumber
 * @param {*} s
 */
export function isPhone (s) {
  return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
}

/**
 * URL
 * @param {*} s
 */
export function isURL (s) {
  return /^http[s]?:\/\/.*/.test(s)
}

/**
 * + INT
 * @param {*} s
 */
export function isNumber (s) {
  return /^\+?[1-9][0-9]*$/.test(s)
}

/**
 * + String
 * @param {*} s
 */
export function isIncludeSymbol (s) {
  return /^[a-zA-Z0-9_-\s]*$/.test(s) || /^[\u4e00-\u9fa5]/.test(s)
}

/**
 * @param {*} s
 */
export function isIncludeDot (s) {
  var rep = /[.]/
  return rep.test(s)
}

/**
 * @param {*} val
 */
export function isEndHaveWithSpaces(val){
  let name = String(val);
  let trimmedName = name
  if (trimmedName.endsWith(' ')){
    return true
  }
}

/**
 * @param {*} content
 */
export function IsIncludetenant_code(content){
  var reg = RegExp(/tenant_code = {tenant_code}/)
  return !reg.exec(content)
}

/**
 * @param {*} content
 */
export function IsChecktenant_code(content){
  var reg = RegExp(/\{tenant_code\}\s*=\s*\{tenant_code\}/i)
  return reg.exec(content)
}

/**
 * @param {*} content
 */
export function IsCheckNotNull(content){
  const reg = RegExp(/\{tenant_code\} is not null/i)
  return reg.exec(content)
}